<template>
  <a-button class="oe_stat_button" @click="onBtnClick(node)">
    <div v-if="node.string">
      <!-- <div>{{ '.' }}</div> -->
      <span>{{ node.string }}</span>
    </div>
    <template v-else>
      <!-- todo StatButton {{ node.nodename }} -->
      <template v-for="node2 in node.children || {}" :key="node2.nodename">
        <!-- {{ node2.nodename }} -->
        <StatInfo :node="node2" :formInfo="{ ...formInfo }" />
      </template>
    </template>
  </a-button>
</template>

<script setup>
import StatInfo from './StatInfo.vue'

defineProps(['node', 'formInfo'])

function onBtnClick(node) {
  console.log(node)
  // alert([node.type, ' todo ', node.name])
}
</script>

<style scoped>
.oe_stat_button {
  /* width: 140px; */
  height: 60px;
}
</style>
